using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace Backend.JYD.AModel.Models.Mapping
{
    public class UserAccountMap : EntityTypeConfiguration<UserAccount>
    {
        public UserAccountMap()
        {
            // Primary Key
            this.HasKey(t => t.AccId);

            // Properties
            this.Property(t => t.CompName)
                .HasMaxLength(10);

            this.Property(t => t.AccCode)
                .HasMaxLength(30);

            // Table & Column Mappings
            this.ToTable("UserAccount");
            this.Property(t => t.AccId).HasColumnName("AccId");
            this.Property(t => t.UserId).HasColumnName("UserId");
            this.Property(t => t.AccType).HasColumnName("AccType");
            this.Property(t => t.CompName).HasColumnName("CompName");
            this.Property(t => t.AccCode).HasColumnName("AccCode");
            this.Property(t => t.IsDefault).HasColumnName("IsDefault");
            this.Property(t => t.Balance).HasColumnName("Balance");
            this.Property(t => t.CashDown).HasColumnName("CashDown");
            this.Property(t => t.CashUp).HasColumnName("CashUp");
            this.Property(t => t.IsValid).HasColumnName("IsValid");
        }
    }
}
